#include "widget.h"
#include "ui_widget.h"

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
}

Widget::~Widget()
{
    delete ui;
}


void Widget::on_pushButton_light_clicked()
{
    // 设置亮色模式
    this->setStyleSheet("background-color: rbg(240,240,240);");
    ui->textEdit->setStyleSheet("background-color: #fff; color: #000;");
    ui->pushButton_light->setStyleSheet("color: #000");
    ui->pushButton_black->setStyleSheet("color: #000");
}

void Widget::on_pushButton_black_clicked()
{
    //设置暗色模式
    this->setStyleSheet("background-color : #000");
    ui->textEdit->setStyleSheet("background-color: #000; color: #fff;");
    ui->pushButton_light->setStyleSheet("background-color: rbg(240,240,240);color: #333");
    ui->pushButton_black->setStyleSheet("background-color: rbg(240,240,240);color: #333");
}
